package org.travel.travel2gether.builder;

import org.travel.travel2gether.domain.Contact;
import org.travel.travel2gether.domain.Track;
import org.travel.travel2gether.dto.TrackForm;

public class TrackBuilder {

	public static Track createTrack(TrackForm trackForm){
		Track track = new Track();
		Contact contact = new Contact();
		
		contact.setFirstName(trackForm.getFirstName());
		contact.setLastName(trackForm.getLastName());
		contact.setSkype(trackForm.getSkype());
		contact.setTelephone(trackForm.getPhone());
		
		track.setContact(contact);
		track.setEndId(trackForm.getTo());
		track.setStartId(trackForm.getFrom());
		
		return track;
	}
}
